package com.isfto.config;

import com.google.code.kaptcha.Producer;
import com.google.code.kaptcha.util.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;
@Configuration
public class KaptchaConfig {
    @Bean
    public Producer captchaProducer() {
        Properties properties = new Properties();
        properties.setProperty( "kaptcha.border", "no" );
        properties.setProperty( "kaptcha.textproducer.font.color", "black" );
        properties.setProperty( "kaptcha.image.width", "110" );
        properties.setProperty( "kaptcha.image.height", "30" );
        properties.setProperty( "kaptcha.textproducer.font.size", "30" );
        properties.setProperty( "kaptcha.textproducer.char.space", "4" );

        Config config = new Config( properties );
        return config.getProducerImpl();
    }
}
